home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-08-18 | 5.4 KB | 269 lines | [TEXT/MPS ] |
- /*------------------------------------------------------------------------------
- #
- # Apple Products Presents
- #
- # S U R F E R ----- A CommToolbox Sample Application
- # by Alex Kazim
- #
- # Based on the MacDTS Simple Sample Application
- #
- # Surfer.r - Rez Source
- #
- # Copyright © 1988-9 Apple Computer, Inc.
- # All rights reserved.
- #
- # Versions: Sample 1.0 08/88
- # Sample 1.01 11/88
- # Surfer 0.5 08/89
- ------------------------------------------------------------------------------*/
-
-
- #include "Types.r"
- #include "SysTypes.r"
- #include "Surfer.h"
-
-
- /* So the Finder can tell who we are */
-
- resource 'vers' (1) {
- 0x01,
- 0x00,
- development,
- 0x12,
- verUS,
- "1.0D1",
- "1.0D1, Copyright © Apple Computer, Inc. 1988-1989. Written by Alex Kazim"
- };
-
-
- /* we use an MBAR resource to conveniently load all the menus */
-
- resource 'MBAR' (rMenuBar, preload) {
- { mApple, mFile, mEdit, mSettings }; /* four menus */
- };
-
-
- resource 'MENU' (mApple, preload) {
- mApple, textMenuProc,
- AllItems & ~MenuItem2, /* Disable dashed line, enable About and DAs */
- enabled, apple,
- {
- "About Surfer…",
- noicon, nokey, nomark, plain;
- "-",
- noicon, nokey, nomark, plain
- }
- };
-
- resource 'MENU' (mFile, preload) {
- mFile, textMenuProc,
- MenuItem15, /* enable Quit only, program enables others */
- enabled, "File",
- {
- "New",
- noicon, "N", nomark, plain;
- "Open",
- noicon, "O", nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Close",
- noicon, "W", nomark, plain;
- "Save",
- noicon, "S", nomark, plain;
- "Save As…",
- noicon, nokey, nomark, plain;
- "Revert",
- noicon, nokey, nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Send File",
- noicon, "T", nomark, plain;
- "Receive File",
- noicon, "R", nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Page Setup…",
- noicon, nokey, nomark, plain;
- "Print…",
- noicon, nokey, nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Quit",
- noicon, "Q", nomark, plain
- }
- };
-
- resource 'MENU' (mEdit, preload) {
- mEdit, textMenuProc,
- NoItems, /* disable everything, program does the enabling */
- enabled, "Edit",
- {
- "Undo",
- noicon, "Z", nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Cut",
- noicon, "X", nomark, plain;
- "Copy",
- noicon, "C", nomark, plain;
- "Paste",
- noicon, "V", nomark, plain;
- "Clear",
- noicon, nokey, nomark, plain
- }
- };
-
- resource 'MENU' (mSettings, preload) {
- mSettings, textMenuProc,
- NoItems, /* disable everything, program does the enabling */
- enabled, "Settings",
- {
- "Connection…",
- noicon, "1", nomark, plain;
- "File Transfer…",
- noicon, "2", nomark, plain;
- "Terminal…",
- noicon, "3", nomark, plain
- }
- };
-
-
- /* this ALRT and DITL are used as an About screen */
-
- resource 'ALRT' (rAboutAlert, purgeable) {
- {40, 20, 180, 400},
- rAboutAlert,
- { /* array: 4 elements */
- /* [1] */
- OK, visible, silent,
- /* [2] */
- OK, visible, silent,
- /* [3] */
- OK, visible, silent,
- /* [4] */
- OK, visible, silent
- }
- };
-
- resource 'DITL' (rAboutAlert, purgeable) {
- { /* array DITLarray: 5 elements */
- /* [1] */
- {99, 285, 119, 365},
- Button {
- enabled,
- "OK"
- },
- /* [2] */
- {8, 8, 26, 250},
- StaticText {
- disabled,
- "SURFER: A CommToolbox Application"
- },
- /* [3] */
- {103, 6, 120, 251},
- StaticText {
- disabled,
- "Copyright © 1988-9 Apple Computer"
- },
- /* [4] */
- {52, 8, 69, 204},
- StaticText {
- disabled,
- "Bytes by Alex, Words by Rob"
- },
- /* [5] */
- {86, 6, 103, 211},
- StaticText {
- disabled,
- "Based on Sample from MacDTS"
- }
- }
- };
-
-
- /* this ALRT and DITL are used as an error screen */
-
- resource 'ALRT' (rUserAlert, purgeable) {
- {40, 20, 180, 350},
- rUserAlert,
- { /* array: 4 elements */
- /* [1] */
- OK, visible, silent,
- /* [2] */
- OK, visible, silent,
- /* [3] */
- OK, visible, silent,
- /* [4] */
- OK, visible, silent
- }
- };
-
-
- resource 'DITL' (rUserAlert, purgeable) {
- { /* array DITLarray: 3 elements */
- /* [1] */
- {100, 230, 120, 310},
- Button {
- enabled,
- "OK"
- },
- /* [2] */
- {10, 60, 76, 310},
- StaticText {
- disabled,
- "^0"
- },
- /* [3] */
- {8, 8, 40, 40},
- Icon {
- disabled,
- 2
- }
- }
- };
-
-
- resource 'WIND' (rWindow, preload, purgeable) {
- {40, 5, 340, 512},
- noGrowDocProc, visible, noGoAway, 0x0, "Surf the Wave"
- };
-
-
- /* we put the latest SIZE template here so we can rez with MPW 2.0 */
-
- type 'SIZE' {
- boolean dontSaveScreen,
- saveScreen;
- boolean ignoreSuspendResumeEvents,
- acceptSuspendResumeEvents;
- boolean enableOptionSwitch,
- disableOptionSwitch;
- boolean cannotBackground,
- canBackground;
- boolean notMultiFinderAware,
- multiFinderAware;
- boolean notOnlyBackground,
- onlyBackground;
- boolean dontGetFrontClicks,
- getFrontClicks;
- unsigned bitstring[9] = 0;
- unsigned longint; /* preferred memory size in bytes */
- unsigned longint; /* minimum memory size in bytes */
- }; /* ignore the warning caused by re-defining SIZE */
-
-
- /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
-
- resource 'SIZE' (-1) {
- dontSaveScreen,
- acceptSuspendResumeEvents,
- enableOptionSwitch,
- canBackground, /* we can background; we don't currently, but our sleep value */
- /* guarantees we don't hog the Mac while we are in the background */
- multiFinderAware, /* this says we do our own activate/deactivate; don't fake us out */
- notOnlyBackground, /* this is definitely not a background-only application! */
- dontGetFrontClicks, /* change this is if you want "do first click" behavior like the Finder */
- kPrefSize * 1024,
- kMinSize * 1024
- };
-